package com.ymt.order.service.impl;

import com.ymt.order.service.OrderCodeService;
import org.springframework.stereotype.Service;

import java.util.UUID;

@Service
public class UUIDOrderCodeServiceImpl implements OrderCodeService {
    private static final String REGEX = "-";
    private static final String REPLACEMENT = "";

    @Override
    public String createOrderCode() {
        String id = UUID.randomUUID().toString().replaceAll(REGEX, REPLACEMENT);
        return id;
    }
}
